#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;
const int N = 2010;


ll comb(ll a, ll b)
{
    ll t1  = 1, t2 = 1;
    for(int i = a; i > a - b; i--) {
        t1 *= i;
    }
    for(int i = b; b > 0; b--){
        t2 *= i;
    }
    return t1 / t2;
}

ll func(string t) {
    int n = t.size();
    ll res = 1;
    map<char, int> mp;
    for(auto ch : t) mp[ch]++;
    for(auto [k, x] : mp) {
        // cout << comb[n, x] << endl;
        res *= comb(n, x);
        n -= x;
    }
}

void solve()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    ll ans = LLONG_MAX;
    string ot;
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++) {
            string t = s;
            t[i] = t[j];
            if(ans > func(t)){
                string ot = t;
                ans = func(t);
            }
            // cout << func(t) << endl;
        }
    }
    cout << ot << endl;
}

int main()
{
    int t = 1;
    cin >> t;
    while (t--)
        solve();
    return 0;
}